package com.coder.oj.system.utils;

import com.coder.oj.common.core.BaseContext;
import com.coder.oj.common.core.BaseEntity;
import com.coder.oj.common.exception.DataException;

public class CheckUserUtils {

    public static void checkCreateBy(BaseEntity entity) {
        if(!BaseContext.getCurrentId().equals(entity.getCreateBy())) {
            throw new DataException("非法操作");
        }
    }
}
